'use strict'

const { ApiController } = require('jax')

class Controller extends ApiController {
  async heroList() {
    const { ctx, app } = this
    const { wzApi } = app

    const res = await wzApi.getHeroList()

    ctx.body = {
      code: 0,
      data: res.data,
    }
  }

  async query() {
    const { ctx, app } = this
    const { wzApi } = app
    const { query } = ctx

    const res = await wzApi.query(query)

    ctx.body = {
      code: 0,
      data: res.data,
    }
  }
}

module.exports = Controller
